package jtk.project4.fleet.screen.emailNotification;

import java.awt.FlowLayout;

import jtk.project4.fleet.field.DriverLicenseInformationField;
import jtk.project4.fleet.field.EmailNotificationField;
import jtk.project4.fleet.field.EmailNotificationField;
import jtk.project4.fleet.field.GeneralInformationField;
import jtk.project4.fleet.field.MicellaneousField;
import jtk.project4.fleet.field.PersonnelInformationField;

import nl.coderight.jazz.form.FormField;
import nl.coderight.jazz.form.FormHeader;
import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.FormView;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.control.TabControl;
import nl.coderight.jazz.form.control.TabItem;
import nl.coderight.jazz.form.field.button.PushButton;

import java.awt.FlowLayout;

import jtk.project4.fleet.field.DriverLicenseInformationField;
import jtk.project4.fleet.field.GeneralInformationField;
import jtk.project4.fleet.field.MicellaneousField;
import jtk.project4.fleet.field.PersonnelInformationField;
import jtk.project4.fleet.templateField.ContohComboDanSelectField;
import jtk.project4.fleet.templateField.ContohRadioButtonField;
import jtk.project4.fleet.templateField.ContohTableField;
import jtk.project4.fleet.templateField.ContohTextField;
import nl.coderight.jazz.action.Action;
import nl.coderight.jazz.form.FormField;
import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.FormView;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.control.TabControl;
import nl.coderight.jazz.form.control.TabItem;
import nl.coderight.jazz.form.field.button.PushButton;
public class NewEmailNotificationView extends FormView{
	
	private PushButton closeButton ;
	private FormHeader formHeader ;
	
	@Override
	protected void init() {
		createFields();
		createLayout();
		
	}
	
	private void createLayout() {
		setHeader(createHeader());
		addField(createForm());
		setResizable(false);
	}
	private void createFields(){
		closeButton = new PushButton("close");
		//System.exit(0);disini
	}
	
	private FormHeader createHeader() {
		formHeader = new FormHeader();
		formHeader.setTitle("Email Notifications");
		return formHeader;
	}
	
	private GroupControl createButtons() {
		GroupControl buttons = new GroupControl();
		buttons.setLayout(new FlowLayout(FlowLayout.RIGHT));
		buttons.addField(closeButton);
		//System.exit(0);disini
		return buttons;
	}
	
	private GroupControl createForm() {
		GroupControl form = new GroupControl();
		// disini add Field yang rekan-rekan buat. contoh
		//form.addField(new ContohTextField("Identification"), NORTH);
		//form.addField(new ContohTextAreaField("Domain"),CENTER);
		form.addField(new EmailNotificationField("Close"),CENTER);
		form.addField(createButtons(),SOUTH);
		return form;
	}
}
